class StudentController < ApplicationController
  before_filter :student_authorize
  
  def index
  end
  
  def search

  end
  
  def edit
    @user = User.find(session[:user_id])
  end
  
  def update
    @user = User.find(session[:user_id])

    respond_to do |format|
      if @user.update_attributes(params[:user])
        format.html { redirect_to student_index_path, notice: 'User was successfully updated.' }
        format.json { head :no_content }
      else
        format.html { render action: "edit" }
        format.json { render json: @user.errors, status: :unprocessable_entity }
      end
    end
  end
  
  def student_info
    @user = User.find(session[:user_id])

    respond_to do |format|
      format.html 
      format.json { render json: @user }
    end
  end
    
  
  def show
    
  end
end
